package com.css.dzj.dzjportal.modules.fxyjinfo;


import com.alibaba.fastjson.JSON;
import com.css.dzj.dzjportal.common.util.R;
import com.css.dzj.dzjportal.common.util.http.HttpClientUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 获取风险预警信息
 */
@RequestMapping("/acquierinfo")
@RestController
public class AcquierinfoController {

    @Value("${FXYJ_URL}")
    private String fxyjUrl;


    @GetMapping("/getAccount")
    public R getOvertimeCount() {
        try {
            String a =  HttpClientUtil.doGet(fxyjUrl + "/acquier/account");
            int result = 0;
            if(!StringUtils.isEmpty(a)){
                result =  Integer.parseInt(JSON.parse(a).toString());
            }
            return R.ok().put("data", result);
        } catch (Exception e) {
            return R.error();
        }
    }

}
